﻿using Factory;
using UnityEngine;

namespace Services.Window
{
    public class WindowService : IWindowService
    {
        private IUiFactory _uiFactory;

        public WindowService(IUiFactory uiFactory) =>
            _uiFactory = uiFactory;

        public GameObject Open(WindowId windowId)
        {
            switch (windowId)
            {
                case WindowId.Root:
                    _uiFactory.CreateUiRoot();
                    return null;
                case WindowId.MenuWindow:
                    return _uiFactory.CreateMenu();
                case WindowId.PauseWindow:
                    return _uiFactory.CreatePause();
                case WindowId.EndGameWindow:
                    return _uiFactory.CreateEndGame();
                default:
                    return null;
            }
        }
    }
}